<template>
	<div class="container" :model="ruleForm" :rules="rules">
		<el-form label-width="140px">
			
		
		<div class="container">
		     <h3>企业信息</h3>
		     <el-row :gutter="20" style="margin-top:20px;">
		             <el-col :span="10" >
		     			<el-form-item label="企业简称：" >
		     				{{ruleForm.abbreviation}}
		     			</el-form-item>
		     			<!-- <el-form-item label="所在区域：" prop="area">
		     				<el-cascader size="large" :options="options" style="width:300px" v-model="form.area" ></el-cascader>
		     			</el-form-item> -->
		     
		     			<el-form-item label="营业执照照片：">
		     				<img v-if="ruleForm.licenseImg" class="imgbox" :src="$store.state.plantImg + ruleForm.licenseImg" alt="">
		     			</el-form-item>
		             </el-col>
		         <el-col :span="12">
		         <el-form-item label="企业名称：">
				 	{{ruleForm.name}}
		         </el-form-item>
		     	
		         <el-form-item label="统一社会信用代码：">
					 {{ruleForm.creditCode}}
		         </el-form-item>
		         <el-form-item label="注册地址：">
					 {{ruleForm.region}}
		         </el-form-item>
		         
		          <el-form-item label="营业期限：">
					{{ruleForm.operateTime}}
		         </el-form-item> 
		     </el-col>
		     </el-row>
		 </div>
		<div class="container" style="margin-top:20px">
		     <h3 style="margin-bottom: 20px">法人信息</h3>
		     <el-row class="demo-ruleForm">
		        <el-col :span="10">
		            <el-form-item label="身份证照片：（人像面）" label-width="100px" style="margin-left:35px;">
		                <img v-if="ruleForm.legalImg" class="imgbox" :src="$store.state.plantImg + ruleForm.legalImg" alt="">
		             </el-form-item>
		             <el-form-item label="身份证照片：（国徽面）" label-width="100px" style="margin-left:35px;">
		                <img v-if="ruleForm.legalIDImg" class="imgbox" :src="$store.state.plantImg + ruleForm.legalIDImg" alt="">
		             </el-form-item>
		         </el-col>
		         <el-col :span="14">
		             <el-form-item label="法人代表：">
		                {{ruleForm.legalName}}
		             </el-form-item>
		             <el-form-item label="身份证号：">
		                 {{ruleForm.legalID}}
		             </el-form-item>
		             
		             <el-form-item label="证件有效期：">
		                 {{ruleForm.legalTime}}
		             </el-form-item>
		            <el-form-item label="手机号：" style="width:500px">
		                {{ruleForm.legalPhone}}
		             </el-form-item>
		         </el-col>
		     </el-row>
		 </div> 
								
		<div class="container" style="margin-top:20px">
			 <h3 style="margin-bottom: 20px">运营者信息</h3>
			 <el-row class="demo-ruleForm">
				<el-col :span="10">
					<el-form-item label="身份证照片：（人像面）" label-width="100px" style="margin-left:35px;">
						<img v-if="ruleForm.operateImg" class="imgbox" :src="$store.state.plantImg + ruleForm.operateImg" alt="">
					</el-form-item>
					<el-form-item label="身份证照片：（国徽面）" label-width="100px" style="margin-left:35px;">
						<img v-if="ruleForm.operateIDImg" class="imgbox" :src="$store.state.plantImg + ruleForm.operateIDImg" alt="">
					</el-form-item>
				</el-col>
				<el-col :span="14">
				
					<el-form-item label="运营人代表：">
						{{ruleForm.operateName}}
					</el-form-item>
					<el-form-item label="身份证号：">
						{{ruleForm.operateID}}
					</el-form-item>
					<el-form-item label="证件有效期：">
						{{ruleForm.operateTime}}		
					</el-form-item>
					<el-form-item label="手机号：" style="width:500px">
						{{ruleForm.operatePhone}}
					</el-form-item>
				</el-col>
			 </el-row>
		 </div> 
		 <!-- <div class="container" style="margin-top:20px;">
			 <h3 style="margin-bottom: 20px">账号信息</h3>
			 <el-row>
				 <el-col>
					<el-form-item label="注册时间">
						
					</el-form-item>
				</el-col>
				<el-col :span="10">
					<el-form-item label="功能配置">
						
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="版本">
						
					</el-form-item>
				</el-col>
			 </el-row>
			
		 </div> -->
		 <div class="container" style="margin-top:20px;">
			 <h3 style="margin-bottom: 20px">审核信息</h3>
			
			 <el-table :data="tableData" border ref="multipleTable" header-cell-class-name="table-header" style="margin-top: 20px">
			     <el-table-column prop="person" sortable label="审核人"></el-table-column>
			     <el-table-column prop="examinedTime" sortable label="审核时间"></el-table-column>
			     <el-table-column prop="differ" sortable label="用时"></el-table-column>
			     <el-table-column prop="passed" sortable label="审核状态">
					 <template slot-scope="scope">
						 <div v-if="scope.row.passed == true">通过</div>
						  <div v-else>驳回</div>
					 </template>
				 </el-table-column>
				 <el-table-column prop="content" sortable label="审核意见"></el-table-column>
			 </el-table>
		 </div>
		 <el-form-item class="footerFixed" label-width="0px">
		    
		     <el-button @click="backPage">返回</el-button>
		 </el-form-item>
		 </el-form>
	</div>                                                                                                                                                                                         
</template>

<script>
	import { company_examinedlist,goverment_check } from "@/request/supervisionCenterApi.js"
	
	export default{
		
		data(){
			return{
				tableData:[],
				ruleForm:{},
				rules:{},
				id:''
			}
		},
		mounted(){
			this.id = this.$route.query.id
			this.init()
		},
		methods:{
			init(){
				// 获取基本信息
				goverment_check(this.id).then((res)=>{
					this.ruleForm = res.data
				})
				// 获取审核记录
				company_examinedlist(this.id).then((res)=>{
					this.tableData = res.data
					for(var i=0;i<this.tableData.length;i++){
						var date1= this.ruleForm.createtime  //开始时间  
						var date2 = new Date(this.tableData[i].examinedTime);    //结束时间  
						var date3 = date2.getTime() - new Date(date1).getTime();   //时间差的毫秒数        
						//计算出相差天数  
						var days=Math.floor(date3/(24*3600*1000))  
						console.log(date3)
						//计算出小时数  
						var leave1=date3%(24*3600*1000)    //计算天数后剩余的毫秒数  
						console.log(leave1)
						var hours=Math.floor(leave1/(3600*1000))  
						//计算相差分钟数  
						var leave2=leave1%(3600*1000)        //计算小时数后剩余的毫秒数  
						var minutes=Math.floor(leave2/(60*1000))  
						//计算相差秒数  
						var leave3=leave2%(60*1000)      //计算分钟数后剩余的毫秒数  
						var seconds=Math.round(leave3/1000)  
						// alert(" 相差 "+days+"天 "+hours+"小时 "+minutes+" 分钟"+seconds+" 秒")
						this.tableData[i].differ = days+"天"+hours+"小时"+minutes+" 分钟"+seconds+" 秒"
						
					}
				})
			},
			// 返回上一页
			backPage(){
				this.$router.go(-1)
			},
			
			
		
		}
	}
</script>

<style scoped>
	.avatar-uploader .el-upload {
	   border: 1px dashed #d9d9d9;
	   border-radius: 6px;
	   cursor: pointer;
	   position: relative;
	   width:180px;
	   overflow: hidden;
	 }
	 
	 .avatar-uploader .el-upload:hover {
	   border-color: #409EFF;
	 }
	 .el-upload--text{
	     width:180px;
	 }
	 .avatar-uploader-icon {
	   font-size: 28px;
	   color: #8c939d;
	   width: 178px;
	   height: 178px;
	   line-height: 178px;
	   text-align: center;
	 }
	 .avatar {
	   width: 178px;
	   height: 178px;
	   display: block;
	 }
	 .imgbox {
		width:200px;
		height: 140px;
	 }
</style>